<?php

use think\migration\Migrator;
use think\migration\db\Column;

class Gather extends Migrator
{
    /**
     * Change Method.
     *
     * Write your reversible migrations using this method.
     *
     * More information on writing migrations is available here:
     * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
     *
     * The following commands can be used in this method and Phinx will
     * automatically reverse them when rolling back:
     *
     *    createTable
     *    renameTable
     *    addColumn
     *    renameColumn
     *    addIndex
     *    addForeignKey
     *
     * Remember to call "create()" or "update()" and NOT "save()" when working
     * with the Table class.
     */
    public function change()
    {
        $table = $this->table('gathers', array('engine' => 'MyISAM', 'comment' => '数据采集表'));
        $table->addColumn('gather_ids', 'string', array('limit' => 255, 'null' => true, 'comment' =>'' ))
            ->addColumn('externalIds', 'text', array( 'null' => true, 'comment' => 'json'))
            ->addColumn('ratingRank', 'string', array('limit' => 255, 'null' => true, 'comment' => '评分排名'))
            ->addColumn('ratingCount', 'string', array('limit' => 255, 'null' => true, 'comment' => '评分次数'))
            ->addColumn('catId3', 'string', array('limit' => 255, 'null' => true, 'comment' => '3级分类ID'))
            ->addColumn('tipInfo', 'string', array('limit' => 255, 'null' => true, 'comment' => ' 提示信息'))
            ->addColumn('subtitle', 'string', array('limit' => 255, 'null' => true, 'comment' => '优惠券标题255'))
            ->addColumn('description', 'text', array(  'null' => true, 'comment' => '抵押物详情'))
            ->addColumn('openingHours', 'text', array('limit' => 500, 'null' => true, 'comment' => '营业时间'))
            ->addColumn('createDate', 'string', array('limit' => 255, 'null' => true, 'comment' => '采集时间'))
            ->addColumn('deliverTime', 'string', array('limit' => 255, 'null' => true, 'comment' => ' 配送时间'))
            ->addColumn('cityPinyin', 'string', array('limit' => 35,  'comment' => '中文城市拼音', 'null' => true))
            ->addColumn('ratingDist', 'text', array( 'null' => true, 'comment' => '评分分布'))
            ->addColumn('title', 'string', array('limit' => 255, 'comment' => '抵押物名称', 'null' => true))
            ->addColumn('imageUrls', 'text', array( 'null' => true, 'comment' => ' 图片链接列表'))
            ->addColumn('appCode', 'string', array('limit' => 255, 'comment' => '平台代码', 'null' => true))
            ->addColumn('state', 'string', array('limit' => 255, 'null' => true, 'comment' => '州、省'))
            ->addColumn('catName1', 'text', array('limit' => 500, 'null' => true, 'comment' => ' 产品类别'))
            ->addColumn('catName4', 'string', array('limit' => 255, 'null' => true, 'comment' => ' 4级分类名'))
            ->addColumn('recommendDishes', 'json', array('limit' => 500, 'comment' => '推荐菜', 'null' => true))
            ->addColumn('country', 'string', array('limit' => 255, 'null' => true, 'comment' => '代理商国别'))
            ->addColumn('coupons', 'string', array('limit' => 255, 'null' => true, 'comment' => '团购、代金券、优惠券'))
            ->addColumn('city', 'string', array('limit' => 255, 'null' => true, 'comment' => '城市'))
            ->addColumn('bulletin', 'string', array('limit' => 255, 'null' => true, 'comment' => '公告信息'))
            ->addColumn('businessDistrict', 'string', array('limit' => 255, 'null' => true, 'comment' => '商圈名'))
            ->addColumn('catName5', 'string', array('limit' => 255, 'null' => true, 'comment' => '5级分类名'))
            ->addColumn('commentCount', 'string', array('limit' => 255, 'null' => true, 'comment' => '评论数'))
            ->addColumn('unifiedId', 'string', array('limit' => 255, 'null' => true, 'comment' => ' 分组id'))
            ->addColumn('catId4', 'string', array('limit' => 255, 'null' => true, 'comment' => ' 4级分类ID'))
            ->addColumn('goodTagDist', 'text', array('null' => true, 'comment' => ' 正面标签列表'))
            ->addColumn('price', 'string', array('limit' => 255, 'null' => true, 'comment' => '  价格'))
            ->addColumn('telephones', 'text', array('null' => true, 'comment' => '代理商联系电话列表'))
            ->addColumn('address', 'string', array('limit' => 255, 'null' => true, 'comment' => '街道地址'))
            ->addColumn('deliverProvider', 'string', array('limit' => 255, 'null' => true, 'comment' => ' 配送服务提供商'))
            ->addColumn('isShutdown', 'string', array('limit' => 255, 'null' => true, 'comment' => '是否关店'))
            ->addColumn('catPathKey', 'string', array('limit' => 255, 'null' => true, 'comment' => ' 分类路径'))
            ->addColumn('minDeliver', 'string', array('limit' => 30, 'null' => true, 'comment' => ' 最低配送金额，单位元'))
            ->addColumn('keyValues', 'string', array('limit' => 30, 'null' => true, 'comment' => ' 其他键值对列表'))
            ->addColumn('url', 'string', array('limit' => 130, 'null' => true, 'comment' => '  菜的url'))
            ->addColumn('otherIds', 'text', array( 'null' => true, 'comment' => '  其他id列表，例如平台的旧id'))
            ->addColumn('lastCommentDate', 'string', array('limit' => 130, 'null' => true, 'comment' => '  最后评论时间'))
            ->addColumn('hzId', 'string', array('limit' => 130, 'null' => true, 'comment' => '   合作者id'))
            ->addColumn('avgPrice', 'string', array('limit' => 255, 'null' => true, 'comment' => '平均价格'))
            ->addColumn('catId5', 'string', array('limit' => 130, 'null' => true, 'comment' => '5级分类ID'))
            ->addColumn('minDeliverFee', 'string', array('limit' => 255, 'null' => true, 'comment' => '最低配送费，单位元'))
            ->addColumn('deliverFee', 'string', array('limit' => 255, 'null' => true, 'comment' => '配送费，单位元'))
            ->addColumn('logiRating', 'string', array('limit' => 255, 'null' => true, 'comment' => '物流评分'))
            ->addColumn('district', 'string', array('limit' => 130, 'null' => true, 'comment' => '区'))
            ->addColumn('rating', 'string', array('limit' => 255, 'null' => true, 'comment' => '评分'))
            ->addColumn('qualRating', 'string', array('limit' => 255, 'null' => true, 'comment' => '质量评分'))
            ->addColumn('tags', 'text', array('null' => true, 'comment' => ' 标签列表'))
            ->addColumn('geoPoint', 'text', array( 'null' => true, 'comment' => ' 经纬度'))
            ->addColumn('catName255', 'text', array( 'null' => true, 'comment' => '  实体二级级类型'))
            ->addColumn('branchTitle', 'string', array('limit' => 130, 'null' => true, 'comment' => '分店名 如：福田店 南山店'))
            ->addColumn('isChainStore', 'string', array('limit' => 255, 'null' => true, 'comment' => '是否连锁店'))
            ->addColumn('hasTakeaway', 'string', array('limit' => 255, 'default' => 1, 'comment' => '是否可以外卖'))
            ->addColumn('visitCount', 'string', array('limit' => 130, 'null' => true, 'comment' => ' 兴趣点的访问数、以及看房量'))
            ->addColumn('likeCount', 'string', array('limit' => 130, 'null' => true, 'comment' => '点赞数'))
            ->addColumn('monthSaleCount', 'string', array('limit' => 255, 'null' => true, 'comment' => '月销量'))
            ->addColumn('location', 'string', array('limit' => 130, 'null' => true, 'comment' => ' 办公位置'))
            ->addColumn('saleStatus', 'string', array('limit' => 130, 'null' => true, 'comment' => '销售状态'))
            ->addColumn('promotions', 'text', array('null' => true, 'comment' => '优惠、促销信息'))
            ->addColumn('servRating', 'string', array('limit' => 255, 'null' => true, 'comment' => '  服务评分'))
            ->addColumn('catName3', 'string', array('limit' => 130, 'null' => true, 'comment' => '3级分类名'))
            ->addColumn('catId1', 'string', array('limit' => 130, 'null' => true, 'comment' => '1级分类ID'))
            ->addColumn('assistServices', 'text', array('null' => true, 'comment' => '辅助服务列表：订座'))
            ->addColumn('badTagDist', 'string', array('limit' => 130, 'null' => true, 'comment' => '负面标签列表'))
            ->addColumn('idVerified', 'string', array('limit' => 255, 'null' => true, 'comment' => '账号是否认证'))
            ->addColumn('hasBooking', 'string', array('limit' => 255, 'null' => true, 'comment' => '是否可以预约'))
            ->addColumn('enviRating', 'string', array('limit' => 255, 'null' => true, 'comment' => '周边环境评分'))
            ->addColumn('openShopTime', 'string', array('limit' => 255, 'null' => true, 'comment' => '开店时间'))
            ->addColumn('floor', 'string', array('limit' => 255, 'null' => true, 'comment' => '楼层'))
            ->addColumn('personnel', 'string', array('limit' => 255, 'null' => true, 'comment' => '开店时间'))
            ->addColumn('area', 'string', array('limit' => 255, 'null' => true, 'comment' => '营业面积'))
            ->addColumn('size', 'string', array('limit' => 255, 'null' => true, 'comment' => '店面尺寸'))
            ->addColumn('recruitment', 'string', array('limit' => 255, 'null' => true, 'comment' => '店招'))
            ->addColumn('numberOfWindows', 'string', array('limit' => 255, 'null' => true, 'comment' => '橱窗数'))
            ->addColumn('wall', 'string', array('limit' => 255, 'null' => true, 'comment' => '店面柱墙'))
            ->addColumn('angle', 'string', array('limit' => 255, 'null' => true, 'comment' => '是否有死角'))
            ->addColumn('decoration_style', 'string', array('limit' => 255, 'null' => true, 'comment' => '装修风格'))
            ->addColumn('zebra_crossing', 'string', array('limit' => 255, 'null' => true, 'comment' => '斑马线'))
            ->addColumn('bus_stop', 'string', array('limit' => 255, 'null' => true, 'comment' => '公交站'))
            ->addColumn('street_width', 'string', array('limit' => 255, 'null' => true, 'comment' => '街道宽度'))
            ->addColumn('steps', 'string', array('limit' => 255, 'null' => true, 'comment' => '障碍物&台阶'))
            ->addColumn('point', 'string', array('limit' => 255, 'null' => true, 'comment' => '聚客点'))
            ->addColumn('side', 'string', array('limit' => 255, 'null' => true, 'comment' => '店面一侧'))
            ->addColumn('box', 'string', array('limit' => 255, 'null' => true, 'comment' => '广告灯箱位'))
            ->addColumn('south', 'string', array('limit' => 255, 'null' => true, 'comment' => '店面朝南'))
            ->addColumn('stool', 'string', array('limit' => 255, 'null' => true, 'comment' => '休闲坐凳'))
            ->addColumn('unification', 'string', array('limit' => 255, 'null' => true, 'comment' => '风格统一'))
            ->addColumn('allowed', 'string', array('limit' => 255, 'null' => true, 'comment' => '允许外开'))
            ->addColumn('intersection', 'string', array('limit' => 255, 'null' => true, 'comment' => '路口位置'))
            ->addColumn('rent', 'string', array('limit' => 255, 'null' => true, 'comment' => '租金'))
            ->addColumn('rental_fee', 'string', array('limit' => 255, 'null' => true, 'comment' => '租赁费'))
            ->addColumn('house_tenancy', 'string', array('limit' => 255, 'null' => true, 'comment' => '房屋租期'))
            ->addColumn('payment', 'string', array('limit' => 255, 'null' => true, 'comment' => '支付方式'))
            ->addColumn('bond', 'string', array('limit' => 255, 'null' => true, 'comment' => '保证金'))
            ->addColumn('front_money', 'string', array('limit' => 255, 'null' => true, 'comment' => '定金'))
            ->addColumn('incremental', 'string', array('limit' => 255, 'null' => true, 'comment' => '递增约定'))
            ->addColumn('rent_free_period', 'string', array('limit' => 255, 'null' => true, 'comment' => '免租期'))
            ->addTimestamps()
            ->addSoftDelete()
            ->create();
    }
}
